package com.systop.student.controller;

import com.systop.common.util.CommonResult;
import com.systop.student.service.StudentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/student")
@Api(tags = "Student",description = "学生模块",hidden = false)
public class StudentController {
    @Autowired
    private StudentService studentService;

    @ApiOperation("查询所有学生")
    @GetMapping("/list")
    public CommonResult list(){
        CommonResult list = studentService.list();
        return list;
    }

    @ApiOperation("根据学号查询学生")
    @GetMapping("/findBysno/{s_no}")
    public CommonResult findbyname(@PathVariable("s_no") String s_no){
        CommonResult byname = studentService.findByname(s_no);
        return byname;
    }

}
